#ifndef TRIGGER_NODE_H
#define TRIGGER_NODE_H
/**
 * .eg
 *      SENDER:void* s_eg
 *      SIGNAL:SIGNAL_EG
 *      RECVER:void* r_eg
 *      SLOT:void eg(void*,uint8_t,void*,_func)
 *      trigger_connect((void *)s_eg,SIGNAL_EG,(void*)r_eg,eg);
 * 
*/
#include <string.h>
#include <pthread.h>
#include <stdint.h>
#define __MAXTRIGSRC 32

typedef enum{
    SIGNAL_NONE,
    SIGNAL_VIFRAME_IN,
}SENDERTYPE;

typedef void (*_func)(void*,uint8_t,void*,void*); //  sender , signal , recver , slot , paramter
struct trigger_node{
    void* sender;
    uint8_t trigsrc;
    _func slot;
    void* recver;
};

typedef struct {
    struct trigger_node *trignode;
}SIG_SLOT_MANAGER;


void trigger_connect(void*sender, uint8_t type, void*recver, _func slot);
void trigger_emit(uint8_t type, void* param);
void trigger_disconnect(void*sender, uint8_t type, void*recver,void*slot);
#endif